﻿using System.Collections.ObjectModel;
using System.Configuration;
using E4D.AppFabric.Entities;
using System.Threading.Tasks;

namespace MDCAdminTool
{
    public class Clusters : ObservableCollection<CacheCluster>
    {
        public string DistributedCacheConfigFile { get; set; }
        public ILogger Logger { get; set; }

        public Clusters()
        {
            
        }

        public void UseLocalCacheCluster()
        {
            var cluster = new CacheCluster {Output = Logger};
            Add( cluster );

            //try
            //{
                //var DistributedCacheConfigFile = Settings.Default.DistributedCacheConfigFile;
                //var tf = new TaskFactory();
                //tf.StartNew( () => 
            cluster.InitCacheCluster(DistributedCacheConfigFile);
                 //   );
            //}
            //finally
            //{
               // Add( cluster );
            //}
        }
    }
}
